<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增出售记录')" />
    <th:block th:include="include :: select2-css"/>
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-record-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">商品：</label>
                <div class="col-sm-8">
                    <select class="form-control m-b" id="commodityId" name="commodityId">
                        <option value="">--商品名称--</option>
                        <option th:each="commodity : ${commodityList}"
                                th:text="${commodity.commodityName}+':价格'+${commodity.commodityPrice}+'￥'"
                                th:value="${commodity.Id}">

                        </option>
                    </select>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">购买人手机号：</label>
                <div class="col-sm-8">
                    <input name="recordPhone" class="form-control" type="text">
                </div>
            </div>

        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: select2-js"/>
    <script th:inline="javascript">
        var prefix = ctx + "system/record"
        $("#form-record-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-record-add').serialize());
            }
        }
    </script>
</body>
</html>
